home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / uim / load-action.scm < prev    next >
Encoding:
Text File  |  2010-11-07  |  3.6 KB  |  91 lines

  1. ;;; load-action.scm: loads action.scm in accordance with platform configuration
  2. ;;;
  3. ;;; Copyright (c) 2003-2009 uim Project http://code.google.com/p/uim/
  4. ;;;
  5. ;;; All rights reserved.
  6. ;;;
  7. ;;; Redistribution and use in source and binary forms, with or without
  8. ;;; modification, are permitted provided that the following conditions
  9. ;;; are met:
  10. ;;; 1. Redistributions of source code must retain the above copyright
  11. ;;;    notice, this list of conditions and the following disclaimer.
  12. ;;; 2. Redistributions in binary form must reproduce the above copyright
  13. ;;;    notice, this list of conditions and the following disclaimer in the
  14. ;;;    documentation and/or other materials provided with the distribution.
  15. ;;; 3. Neither the name of authors nor the names of its contributors
  16. ;;;    may be used to endorse or promote products derived from this software
  17. ;;;    without specific prior written permission.
  18. ;;;
  19. ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
  20. ;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. ;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
  23. ;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25. ;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26. ;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27. ;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28. ;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29. ;;; SUCH DAMAGE.
  30. ;;;;
  31.  
  32. (require "util.scm")
  33. (require "i18n.scm")
  34.  
  35. (define indication-rec-spec
  36.   '((id           #f) ;; must be first member
  37.     (iconic-label "")
  38.     (label        "")
  39.     (short-desc   "")))
  40. (define-record 'indication indication-rec-spec)
  41.  
  42. (define indication-alist-entry-extract-choice
  43.   (lambda (entry)
  44.     (let ((act-id (car entry))
  45.       (indication (cdr entry)))
  46.       (list act-id
  47.         (indication-label indication)
  48.         (indication-short-desc indication)))))
  49.  
  50. (define action-id-list->choice
  51.   (lambda (act-ids indication-alist)
  52.     (map (lambda (act)
  53.        (indication-alist-entry-extract-choice
  54.         (assq act indication-alist)))
  55.      act-ids)))
  56.  
  57. ;; Unifying custom variable definitions and actions of toolbar button
  58. ;; widgets is impossible at current libuim implementation. It requires
  59. ;; library-wide default encoding configurability rather than per
  60. ;; context encoding.  -- YamaKen 2005-01-31
  61. (define indication-alist-indicator
  62.   (lambda (act-id alist)
  63.     (let* ((indication (cdr (assq act-id alist)))
  64.        (orig-codeset (bind-textdomain-codeset (gettext-package) #f))
  65.        (cur-codeset (bind-textdomain-codeset (gettext-package) "EUC-JP"))
  66.        (translated (list (indication-id indication)
  67.                  (indication-iconic-label indication)
  68.                  (indication-label indication)
  69.                  (indication-short-desc indication))))
  70.       (bind-textdomain-codeset (gettext-package) (or orig-codeset
  71.                              "UTF-8"))
  72.       (lambda (owner)
  73.     translated))))
  74.  
  75. (define do-nothing
  76.   (lambda args
  77.     #f))
  78. (define register-widget do-nothing)
  79. (define register-action do-nothing)
  80. (define indicator-new do-nothing)
  81. (define activity-indicator-new do-nothing)
  82. (define actions-new do-nothing)
  83. (define context-init-widgets do-nothing)
  84. (define context-list-replace-widgets! do-nothing)
  85. (define context-update-widgets do-nothing)
  86. (define context-prop-activate-handler do-nothing)
  87. (define context-mode-handler do-nothing)
  88. ;; override above procedures
  89. (if enable-action?
  90.     (require "action.scm"))
  91.